/*
 * @Author: linZeJian
 * @Date: 2022-02-14 15:40:19
 * @LastEditors: linZeJian
 * @LastEditTime: 2022-02-28 14:43:36
 * @Description:
 */

import request from "../utils/request";

class filebaseUrl {
  constructor() {}

  /**
   * @description: 上传文件
   * @param {any} obj
   * @return {*}
   */
  async uploadFiles(obj: any) {
    console.log('99999999999', 99999999999)
    return
    let name = new Date().getTime();
    let res = await request({
      headers: { "Content-Type": "multipart/form-data" },
      baseURL: "/filebase",
      method: "POST",
      url: `/api/v1/app/files?format=base64&name=${name}&size=-1`,
      data: obj,
    });
    return res;
  }

  /**
   * @description: 下载查看文件
   * @param {any} obj
   * @return {*}
   */
  async dowmloadFiles(obj: any) {
    let name = new Date().getTime();
    let res = await request({
      headers: { "Content-Type": "multipart/form-data" },
      baseURL: "/filebase",
      method: "POST",
      url: `/api/v1/app/files?format=base64&name=${name}&size=-1`,
      data: obj,
    });
    return res;
  }
}

const FilebaseUrl = new filebaseUrl();
export default FilebaseUrl;
// import FilebaseUrl from "@/api/filebase";
// await FilebaseUrl.uploadFiles(val.id);
